home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 1.0 / CIncludes / Devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  7.9 KB  |  274 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Devices.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __DEVICES__
  13. #define __DEVICES__
  14.  
  15. #ifndef __OSUTILS__
  16. #include <OSUtils.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. #endif
  22.  
  23. #ifndef __FILES__
  24. #include <Files.h>
  25. /*    #include <SegLoad.h>                                        */
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29. #include <Quickdraw.h>
  30. /*    #include <QuickdrawText.h>                                    */
  31. /*        #include <IntlResources.h>                                */
  32. #endif
  33.  
  34. #ifndef __EVENTS__
  35. #include <Events.h>
  36. #endif
  37.  
  38. #ifndef __DIALOGS__
  39. #include <Dialogs.h>
  40. /*    #include <Windows.h>                                        */
  41. /*        #include <Controls.h>                                    */
  42. /*            #include <Menus.h>                                    */
  43. /*    #include <TextEdit.h>                                        */
  44. #endif
  45.  
  46. #ifndef __DESK__
  47. #include <Desk.h>
  48. #endif
  49.  
  50. enum  {
  51.     newSelMsg                    = 12,
  52.     fillListMsg                    = 13,
  53.     getSelMsg                    = 14,
  54.     selectMsg                    = 15,
  55.     deselectMsg                    = 16,
  56.     terminateMsg                = 17,
  57.     buttonMsg                    = 19,
  58.     chooserID                    = 1,
  59.     initDev                        = 0,                            /*Time for cdev to initialize itself*/
  60.     hitDev                        = 1,                            /*Hit on one of my items*/
  61.     closeDev                    = 2,                            /*Close yourself*/
  62.     nulDev                        = 3,                            /*Null event*/
  63.     updateDev                    = 4,                            /*Update event*/
  64.     activDev                    = 5,                            /*Activate event*/
  65.     deactivDev                    = 6,                            /*Deactivate event*/
  66.     keyEvtDev                    = 7,                            /*Key down/auto key*/
  67.     macDev                        = 8,                            /*Decide whether or not to show up*/
  68.     undoDev                        = 9,
  69.     cutDev                        = 10,
  70.     copyDev                        = 11
  71. };
  72.  
  73. enum  {
  74.     pasteDev                    = 12,
  75.     clearDev                    = 13,
  76.     cursorDev                    = 14,
  77.     cdevGenErr                    = -1,                            /*General error; gray cdev w/o alert*/
  78.     cdevMemErr                    = 0,                            /*Memory shortfall; alert user please*/
  79.     cdevResErr                    = 1,                            /*Couldn't get a needed resource; alert*/
  80.     cdevUnset                    = 3,                            /* cdevValue is initialized to this*/
  81. /* Monitors control panel messages */
  82.     initMsg                        = 1,                            /*initialization*/
  83.     okMsg                        = 2,                            /*user clicked OK button*/
  84.     cancelMsg                    = 3,                            /*user clicked Cancel button*/
  85.     hitMsg                        = 4,                            /*user clicked control in Options dialog*/
  86.     nulMsg                        = 5,                            /*periodic event*/
  87.     updateMsg                    = 6,                            /*update event*/
  88.     activateMsg                    = 7,                            /*not used*/
  89.     deactivateMsg                = 8,                            /*not used*/
  90.     keyEvtMsg                    = 9,                            /*keyboard event*/
  91.     superMsg                    = 10,                            /*show superuser controls*/
  92.     normalMsg                    = 11,                            /*show only normal controls*/
  93.     startupMsg                    = 12                            /*code has been loaded*/
  94. };
  95.  
  96. #if defined(powerc) || defined (__powerc)
  97. #pragma options align=mac68k
  98. #endif
  99. struct DCtlEntry {
  100.     Ptr                            dCtlDriver;
  101.     short                        dCtlFlags;
  102.     QHdr                        dCtlQHdr;
  103.     long                        dCtlPosition;
  104.     Handle                        dCtlStorage;
  105.     short                        dCtlRefNum;
  106.     long                        dCtlCurTicks;
  107.     WindowPtr                    dCtlWindow;
  108.     short                        dCtlDelay;
  109.     short                        dCtlEMask;
  110.     short                        dCtlMenu;
  111. };
  112. #if defined(powerc) || defined(__powerc)
  113. #pragma options align=reset
  114. #endif
  115.  
  116. typedef struct DCtlEntry DCtlEntry;
  117.  
  118. typedef DCtlEntry *DCtlPtr, **DCtlHandle;
  119.  
  120. #if defined(powerc) || defined (__powerc)
  121. #pragma options align=mac68k
  122. #endif
  123. struct AuxDCE {
  124.     Ptr                            dCtlDriver;
  125.     short                        dCtlFlags;
  126.     QHdr                        dCtlQHdr;
  127.     long                        dCtlPosition;
  128.     Handle                        dCtlStorage;
  129.     short                        dCtlRefNum;
  130.     long                        dCtlCurTicks;
  131.     GrafPtr                        dCtlWindow;
  132.     short                        dCtlDelay;
  133.     short                        dCtlEMask;
  134.     short                        dCtlMenu;
  135.     char                        dCtlSlot;
  136.     char                        dCtlSlotId;
  137.     long                        dCtlDevBase;
  138.     Ptr                            dCtlOwner;
  139.     char                        dCtlExtDev;
  140.     char                        fillByte;
  141. };
  142. #if defined(powerc) || defined(__powerc)
  143. #pragma options align=reset
  144. #endif
  145.  
  146. typedef struct AuxDCE AuxDCE;
  147.  
  148. typedef AuxDCE *AuxDCEPtr, **AuxDCEHandle;
  149.  
  150. typedef pascal long (*ControlPanelDefProcPtr)(short message, short item, short numItems, short cPanelID, EventRecord *theEvent, long cdevValue, DialogPtr cpDialog);
  151.  
  152. enum {
  153.     uppControlPanelDefProcInfo = kPascalStackBased
  154.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  155.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  156.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  157.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  158.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  159.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(EventRecord*)))
  160.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  161.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(DialogPtr)))
  162. };
  163.  
  164. #if USESROUTINEDESCRIPTORS
  165. typedef UniversalProcPtr ControlPanelDefUPP;
  166.  
  167. #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog)        \
  168.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlPanelDefProcInfo, (message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
  169. #define NewControlPanelDefProc(userRoutine)        \
  170.         (ControlPanelDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlPanelDefProcInfo, GetCurrentISA())
  171. #else
  172. typedef ControlPanelDefProcPtr ControlPanelDefUPP;
  173.  
  174. #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog)        \
  175.         (*(userRoutine))((message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
  176. #define NewControlPanelDefProc(userRoutine)        \
  177.         (ControlPanelDefUPP)(userRoutine)
  178. #endif
  179.  
  180. #ifdef __cplusplus
  181. extern "C" {
  182. #endif
  183.  
  184. extern pascal DCtlHandle GetDCtlEntry(short refNum);
  185.  
  186. /*
  187.     SetChooserAlert used to simply set a bit in a low-mem global
  188.     to tell the Chooser not to display its warning message when
  189.     the printer is changed. However, under MultiFinder and System 7,
  190.     this low-mem is swapped out when a layer change occurs, and the
  191.     Chooser never sees the change. It is obsolete, and completely
  192.     unsupported on the PowerPC. 68K apps can still call it if they
  193.     wish.
  194. */
  195.  
  196. #if defined(OBSOLETE) && !defined(powerc) && !defined(__powerc)
  197. extern pascal Boolean SetChooserAlert(Boolean f);
  198. #endif
  199.  
  200. extern pascal OSErr DrvrInstall(Handle drvrHandle, short refNum);
  201. extern pascal OSErr DrvrRemove(short refNum);
  202. extern pascal OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum);
  203. extern OSErr opendriver(char *driverName, short *refNum);
  204. extern pascal OSErr CloseDriver(short refNum);
  205. extern pascal OSErr Control(short refNum, short csCode, const void *csParamPtr);
  206. extern pascal OSErr Status(short refNum, short csCode, void *csParamPtr);
  207. extern pascal OSErr KillIO(short refNum);
  208.  
  209. #if USES68KINLINES
  210. #pragma parameter __D0 PBControlSync(__A0)
  211. #endif
  212. extern pascal OSErr PBControlSync(ParmBlkPtr paramBlock)
  213.  ONEWORDINLINE(0xA004);
  214.  
  215. #if USES68KINLINES
  216. #pragma parameter __D0 PBControlAsync(__A0)
  217. #endif
  218. extern pascal OSErr PBControlAsync(ParmBlkPtr paramBlock)
  219.  ONEWORDINLINE(0xA404);
  220.  
  221. #if USES68KINLINES
  222. #pragma parameter __D0 PBControlImmed(__A0)
  223. #endif
  224. extern pascal OSErr PBControlImmed(ParmBlkPtr paramBlock)
  225.  ONEWORDINLINE(0xA204);
  226.  
  227. #if USES68KINLINES
  228. #pragma parameter __D0 PBStatusSync(__A0)
  229. #endif
  230. extern pascal OSErr PBStatusSync(ParmBlkPtr paramBlock)
  231.  ONEWORDINLINE(0xA005);
  232.  
  233. #if USES68KINLINES
  234. #pragma parameter __D0 PBStatusAsync(__A0)
  235. #endif
  236. extern pascal OSErr PBStatusAsync(ParmBlkPtr paramBlock)
  237.  ONEWORDINLINE(0xA405);
  238.  
  239. #if USES68KINLINES
  240. #pragma parameter __D0 PBStatusImmed(__A0)
  241. #endif
  242. extern pascal OSErr PBStatusImmed(ParmBlkPtr paramBlock)
  243.  ONEWORDINLINE(0xA205);
  244.  
  245. #if USES68KINLINES
  246. #pragma parameter __D0 PBKillIOSync(__A0)
  247. #endif
  248. extern pascal OSErr PBKillIOSync(ParmBlkPtr paramBlock)
  249.  ONEWORDINLINE(0xA006);
  250.  
  251. #if USES68KINLINES
  252. #pragma parameter __D0 PBKillIOAsync(__A0)
  253. #endif
  254. extern pascal OSErr PBKillIOAsync(ParmBlkPtr paramBlock)
  255.  ONEWORDINLINE(0xA406);
  256.  
  257. #if USES68KINLINES
  258. #pragma parameter __D0 PBKillIOImmed(__A0)
  259. #endif
  260. extern pascal OSErr PBKillIOImmed(ParmBlkPtr paramBlock)
  261.  ONEWORDINLINE(0xA206);
  262. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  263.  
  264. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  265.  
  266. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  267.  
  268. #ifdef __cplusplus
  269. }
  270. #endif
  271.  
  272. #endif
  273.  
  274.